{extend name="$_tpl_public_layout_danceadmin"/}


{block name="breadcrumb"}
<ol class="breadcrumb">
	<li class="breadcrumb-item"><a href="{:url('admin/index/index')}">{:config('system.site_title')}</a></li>
	<li class="breadcrumb-item"><a href="{:url('admin/weixinAccount/index')}">{$weixinAccountInfo['wxname']}</a></li>
	<li class="breadcrumb-item"><a href="{:url('weixin_manage/event/index', ['wid'=>$wid])}">{$sideName}</a></li>
</ol>
{/block}


{block name="pageheader"}
{$sideName}
{/block}


{block name="content"}
{include file="index:nav" /}

<div class="card">
	<div class="card-body">
		<form method="post" action="{:url('weixin_manage/event/doAdd', array('wid'=>$wid))}" enctype="multipart/form-data" class="form-horizontal J_ajaxForm">
			<input type="hidden" name="id" value="{$id}" />
			<div class="form-group row">
				<label class="col-sm-2 control-label">触发文字</label>
				<div class="col-sm-5">
					<input type="text" name="data[event_text]" value="{$info['event_text']}" class="form-control">
				</div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">菜单关联关键字</label>
				<div class="col-sm-5"><input type="text" name="data[event_key]" value="{$info['event_key']}" class="form-control"></div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">消息类型</label>
				<div class="col-sm-5">
					<?php echo optionRadioHtmlB(config('moduleconfig.msgtype_config'), 'data[event_msgtype]', $info['event_msgtype']); ?>
				</div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">标题</label>
				<div class="col-sm-5"><input type="text" name="data[title]" value="{$info['title']}" class="form-control"></div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">描述</label>
				<div class="col-sm-5"><textarea name="data[descrip]" class="form-control" rows="5">{$info['descrip']}</textarea></div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">链接</label>
				<div class="col-sm-5"><input type="text" name="data[link]" value="{$info['link']}" class="form-control"></div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">图片</label>
				<div class="col-sm-5">
					<div class="upload-control">
						<input type="file" name="picurl" class="J_uploadfile" />
					</div>
					<div class="upload-show J_preview">
						<img src="{$info['picurl']}" class="upload-img-sm" onerror="Javascript:this.src='/static/danceAdmin/images/nopic.png';" />
					</div>
					<div class="upload-help">不做压缩处理，大小2M以下,建议尺寸640×280px</div>
				</div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">状态</label>
				<div class="col-sm-5">
					<?php echo isOpenRadioHtmlB('data[isopen]', $info['isopen']); ?>
				</div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">参数带openid</label>
				<div class="col-sm-5">
					<?php echo isOpenRadioHtmlB('data[is_append_openid]', $info['is_append_openid']); ?>
				</div>
				<div class="col-sm-5 help-block">一般不用设置</div>
			</div>
			<div class="clearfix form-actions">
				<div class="offset-md-2 col-sm-10">
					<button type="submit" class="btn btn-primary J_ajaxSubmit">保存修改</button>
				</div>
			</div>
		</form>
	</div>
</div>
{/block}


{block name="script"}
<!-- 上传图片展示 -->
<script type="text/javascript" src="__STATIC__/dancewidgets/uploadPreview/uploadPreview.js"></script>
{/block}